/************************************************************
 * Project Name		[Thinking_In_Java]
 * File Name     	[Pair.java]
 * Creation Date 	[28-Jun-2014]
 * 
 * Copyright© ge.y.yang@gmail.com All Rights Reserved
 * 
 * Work hard, play harder, think big and keep fit
 ************************************************************/
package pkg_07_generics;

/**
 * 定义一个泛型类
 * 
 * @author 不落的太阳(Sean Yang)
 * @version 1.0
 * @since JDK 6
 * 
 */
public class Pair<T> {

	private T first;
	private T second;

	/**
	 * 构造方法
	 */
	public Pair() {
		super();
		first = second = null;
	}

	/**
	 * 构造方法
	 * 
	 * @param first
	 * @param second
	 */
	public Pair(T first, T second) {
		super();
		this.first = first;
		this.second = second;
	}

	/**
	 * @return the first
	 */
	public T getFirst() {
		return first;
	}

	/**
	 * @param first
	 *            the first to set
	 */
	public void setFirst(T first) {
		this.first = first;
	}

	/**
	 * @return the second
	 */
	public T getSecond() {
		return second;
	}

	/**
	 * @param second
	 *            the second to set
	 */
	public void setSecond(T second) {
		this.second = second;
	}

	/**
	 * toString方法
	 */
	@Override
	public String toString() {
		return "Pair [first=" + first + ", second=" + second + "]";
	}

}
